<template>
	<view class="page">
		<!-- 快递 -->
		<view class="express">
			<view class="top ali-c">
				<view class="text">
					<view class="text1">快递名称：</view>
					<view class="text1">{{wlInfo.express_name}}</view>
				</view>
				<view class="text">
					<view class="text1">快递单号：</view>
					<view class="text1">{{wlInfo.shipping_code}}</view>
				</view>
			</view>
		</view>

		<!-- 收货地址 -->
		<view class="content bgf">
			<view>
				<view class="flex list">
					<view class="info flex1">
						<view class="title address">
							<view class="text">
								[收货地址]{{wlInfo.address}}
							</view>
						</view>
					</view>
				</view>
				<view class="flex list" :class="{one: index == 0 && wlInfo.deliver_type == 1,one1:index==0&&wlInfo.deliver_type==2}"
					v-for="(item, index) in wlInfo.deliver_info" :key="index">
					<view class="info flex1">
						<view class="title">{{item.status}}</view>
						<view class="main">
							<view class="text">{{item.context}}</view>
							<view class="text">
								{{item.time}}
							</view>
						</view>
					</view>
				</view>
				<view class="flex" v-if="wlInfo.deliver_info&&wlInfo.deliver_info.length==0">
					暂无物流信息
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "Logistics",
		props: {
			wlInfo: {
				type: Object,
				default: () => ({})
			}
		},
		data() {
			return {}
		},

		onLoad() {
			console.log(wlInfo.deliver_info)
		},

		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.page {
		height: 100vh;
		/* #ifdef H5 */
		height: calc(100vh - 44px);
		/* #endif */
		font-size: 24rpx;
		background-color: #F6F7F8;
		overflow-y: auto;
	}

	/*flex 转换成flex容器*/
	.flex {
		display: flex;
		flex-direction: row;
	}


	/*ali-c 竖直居中*/
	.ali-c {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.bgf {
		background-color: #fff;
	}

	.express {
		//快递
		background-color: #ffffff;
		border-radius: 20rpx;
		margin: 30rpx 20rpx 30rpx 20rpx;

		.top {
			padding: 28rpx 29rpx 25rpx 29rpx;
			    display: flex;
			    flex-direction: column;
			    align-items: flex-start;

			.text {
				margin-left: 20rpx;
				display:flex;

				.text1 {
					margin-bottom: 6rpx;
					font-size: 28rpx;
					color: #000000;
				}
			}
		}
	}

	//收货地址
	.content {
		margin: 20rpx;
		padding: 40rpx;
		border-radius: 20rpx;

		.list {
			&:first-child {
				.info::before {
					bottom: -20rpx;
					margin-top: 40rpx;
					border-left: 1px dashed #e5e5e5;
				}

				.title {
					margin-bottom: 56rpx;

					&::before {
						width: 50rpx;
						height: 50rpx;
						left: -23rpx;
						background: url('') no-repeat center;
						background-size: 50rpx 50rpx;
					}
				}
			}
			&:last-child {
				.info::before {
					height: 32rpx;
				}
			}

			&.one {
				.info::before {
					margin-top: 20rpx;
				}

				.title {
					color: #1a1a1a;

					&::before {
						width: 46rpx;
						height: 46rpx;
						left: -23rpx;
						background: url('') no-repeat center;
						background-size: 46rpx 46rpx;
					}
				}

				.text {
					color: #666;
				}
			}
			&.one1 {
				.info::before {
					margin-top: 20rpx;
				}
			
				.title {
					color: #1a1a1a;
			
					&::before {
						width: 46rpx;
						height: 46rpx;
						left: -23rpx;
						background: url('') no-repeat center;
						background-size: 46rpx 46rpx;
					}
				}
			
				.text {
					color: #666;
				}
			}
		}

		.info {
			position: relative;
			padding-top: 12rpx;
			color: #999;

			&::before {
				content: "";
				position: absolute;
				left: 0;
				top: 0;
				bottom: 0;
				z-index: 1;
				width: 0;
				border-left: 1px solid #e5e5e5;
			}

			.title {
				position: relative;
				margin-bottom: 10rpx;
				padding-left: 32rpx;
				font-size: 28rpx;

				&::before {
					content: "";
					position: absolute;
					left: -3px;
					top: 0;
					bottom: 0;
					z-index: 1;
					width: 7px;
					height: 7px;
					margin: auto 0;
					border-radius: 50%;
					background-color: #cecece;
				}

				&.address {
					font-size: 24rpx;
					color: #333;
				}
			}

			.text {
				margin-left: 20rpx;
			}
		}
	}
</style>